import * as THREE from 'three'
import Base3D from '../index'
export default class Lights {
  constructor() {
    this.base3D = Base3D.getInstance()
    this.ambientLight
    this.hemisphereLight
    this.init()
  }

  init() {
    this.createAmbientLight()
    this.createHemisphereLight()
  }

  // 创建环境光
  createAmbientLight() {
    console.error('init  AmbientLight========>')
    this.ambientLight = new THREE.AmbientLight(0x444444, 1)
    this.base3D.scene.add(this.ambientLight)
  }

  // 半球光
  createHemisphereLight() {
    console.error('init  HemisphereLight========>')
    this.hemisphereLight = new THREE.HemisphereLight(0xffffff, 0xdddddd, 1)
    this.base3D.scene.add(this.hemisphereLight)
  }
}
